#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui>
#include <QMainWindow>
#include <phonon/MediaObject>
#include <phonon/AudioOutput>
#include <phonon/VideoPlayer>

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:
    void stateChanged(Phonon::State, Phonon::State);
    void play();
    void paused();
    void stop();
    void next();
    void previous();
    void timeOut();

    void viewPrintoutClicked();
    void viewVideoClicked();
    void videoReplay();

private:
    void setupDir();
    void setupActions();
    void setupTable();
    void setupUi();

    void playPosition();

    Phonon::MediaObject *mediaObject;
    Phonon::AudioOutput *audioOutput;

    Phonon::VideoPlayer *videoPlayer;
    QString videoFileName;

    QList<QString> techniqueList;
    QList<Phonon::MediaSource> sourceList;

    QTableWidgetItem *tableItem;
    QTableWidget *table;
    QPushButton *viewVideo;
    QPushButton *viewPrintout;

    QAction *playAction;
    QAction *pauseAction;
    QAction *nextAction;
    QAction *previousAction;

    QTimer *timer;

    int currentTechIndex;
    bool wasPosition;
};

#endif // MAINWINDOW_H
